import { iup } from '../../util';
/**
 * 获取详情信息
 * @param
 * @returns
 */
export const getByBizCode = async (data) => {
  try {
    const result = await iup.request.get({
      url: `engine/metadataExcelImportMain/getTemplateByBizCode`,
      data
    });
    if (result.code === 0) {
      return result;
    } else {
      iup.alert(result.message);
      return { data: {} };
    }
  } catch (e) {
    iup.alert('接口调用失败');
    return { data: {} };
  }
};

/**
 * 模版导入
 * @param params
 * @returns
 */
export const exportTemplate = async (data) => {
  try {
    const result = await iup.request.body({
      url: `/engine/metadataExcelImportMain/exportCustomizeTemplate`,
      data
    });
    return result;
  } catch (e) {
    iup.alert('接口调用失败');
    return { code: 500, message: '失败' };
  }
};
